/**
 *  切换皮肤指令
 */
const setTheme = {
    bind: (el, binding, vnode) => {
        console.log(binding)
        // eslint-disable-next-line no-undef
        // if (binding.value === '') return
        el.style.setProperty('color', binding.value.color, 'important')
    },
    update: (el, binding, vnode) => {
        // if (binding.value === '') return
        el.style.setProperty('color', binding.value.color, 'important')
    }
}
const install = function(Vue) {
    Vue.directive('setTheme', setTheme)
}

if (window.Vue) {
    window.setTheme = setTheme
    Vue.use(install); // eslint-disable-line
}

setTheme.install = install

export default setTheme
